.\" Copyright (C) 2004 International Business Machines Corporation
.\" Written by Kathy Robertson based on the Trusted Computing Group Software Stack Specification Version 1.1 Golden
.\"
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "Tspi_Policy_SetSecret" 3 "2004-05-26" "TSS 1.1" "TCG Software Stack Developer's Reference"
.SH NAME
Tspi_Policy_SetSecret \- set the authorization data of a policy object and define the handling of its retrieval
.SH "SYNOPSIS"
.ad l
.hy 0
.nf
.B #include <tss/platform.h>
.B #include <tss/tcpa_defines.h>
.B #include <tss/tcpa_typedef.h>
.B #include <tss/tcpa_struct.h>
.B #include <tss/tss_typedef.h>
.B #include <tss/tss_structs.h>
.B #include <tss/tspi.h>
.sp
.BI "TSS_RESULT Tspi_Policy_SetSecret(TSS_HPOLICY " hPolicy ",        TSS_FLAG " secretMode ","
.BI "                                 UINT32      " ulSecretLength ", BYTE*    " rgbSecret ");"
.fi
.sp
.ad
.hy

.SH "DESCRIPTION"
.PP
\fBTSS_Policy_SetSecret\fR  
sets the authorization data for an object. This mthod also defines the handling of its retrieving. There are mand different paths as specified by the secretMode Flag.
.SH "PARAMETERS"
.PP
.SS hPolicy
The handle of the policy object.
.PP
.SS secretMode
Flag indicating the policy secret mode to set. Possible values are:
 \fBTSS_SECRET_MODE_SHA1\fR - Secret in the form of 20 bytes of SHA-1 data. The secret will not be touched by the TSP.
 \fBTSS_SECRET_MODE_PLAIN\fR - The data passed in will be hashed by the TSP using SHA-1.
 \fBTSS_SECRET_MODE_POPUP\fR - The TSP will ask for a secret by displaying a GUI pop-up window.
 \fBTSS_SECRET_MODE_CALLBACK\fR - The application will provide a callback function for authorization data.
 \fBTSS_SECRET_MODE_NONE\fR - \fIulSecretLen\fR and \fIrgbSecret\fR are ignored and any object requiring auth assigned this policy will return an error.
.PP
.SS ulSecretLength
The length (in bytes) of the rgbSecret parameter.
.PP
.SS rgbSecret
The secret data blob.
.SH "RETURN CODES"
.PP
\fBTspi_Policy_SetSecret\fR returns TSS_SUCCESS on success, otherwise one of the following values are returned:
.TP
.SM TSS_E_INVALID_HANDLE - hPolicy is an invalid parameter.
.TP
.SM TSS_E_INTERNAL_ERROR - An error occurred internal to the TSS.
.SH "CONFORMING TO"

.PP
\fBTspi_Policy_SetSecret\fR conforms to the Trusted Computing Group Software Specification version 1.1 Golden
.SH "SEE ALSO"

.PP
\fBTspi_Policy_FlushSecret\fR(3).
